package com.cudex.mb;

import java.util.List;
import java.util.logging.Logger;

import javax.ejb.EJB;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.SessionScoped;

import org.primefaces.model.chart.PieChartModel;

import com.cudex.negocio.Manager.IManagerCliente;

@ManagedBean
@SessionScoped
public class ChartBean {
	private static final Logger log = Logger.getLogger(ChartBean.class
			.getName());
	// @EJB
	// IBarracaManager manager;

//	@EJB
//	IManagerCliente manager;

	private List<Sale> sales;

	private PieChartModel model;

	public ChartBean() {
		// sales = new ArrayList<Sale>();
		// sales.add(new Sale("Brand 1", 540));
		// sales.add(new Sale("Brand 2", 325));
		// sales.add(new Sale("Brand 3", 702));
		// sales.add(new Sale("Brand 4", 421));

		model = new PieChartModel();

		model.set("Timber", 540);
		model.set("Cliente 2", 325);
		model.set("Brinol", 702);
		model.set("Cliente 3", 421);

//		log.info("Manager : " + manager.equals(null));

		// ArrayList<Clientes> cli = manager.buscarClientes();
		//
		// for (int i = 0; i < cli.size(); i++) {
		// model.set(cli.get(i).getNombre(), (1 + i) * 6);
		// }

	}

	public List<Sale> getSales() {
		return sales;
	}

	/**
	 * @return the model
	 */
	public PieChartModel getModel() {
		return model;
	}

}
